import React from 'react'
import { Button } from 'antd'
import propTypes from 'prop-types'
export default class Child extends React.Component{
    static propsTypes={
        toson:propTypes.string,
        fromSon:propTypes.func
    }
    render(){
        let {toson,fromSon}=this.props
        return <>
          <h3>------子组件-------</h3>
          <div>
              <p>来自父组件的信息：》》 <span style={{color:'#0f0'}}>{toson}</span> </p>
              <Button type='primary' onClick={ev=>{fromSon('子组件修改了的次数')}}>改变父组件信息</Button>
          </div>
        </>
    }
}